using HKB.Common;
using System;
using System.Data;
using System.Web;
namespace HKB.Web
{
	public class Shop_BuyMoney
	{
		private Conn conn = null;
		private Pagination _pageHand = null;
		protected Pagination pageHand
		{
			get
			{
				Pagination pageHand;
				if (this._pageHand == null)
				{
					this._pageHand = new Pagination();
					this._pageHand.SQL_CloseTablePre = false;
					this._pageHand.P_Object = Language.GetAdminMsg("BuyMoney/Name");
					pageHand = this._pageHand;
				}
				else
				{
					pageHand = this._pageHand;
				}
				return pageHand;
			}
		}
		public Shop_BuyMoney()
		{
			this.conn = Text.GetComponent<Conn>("conn", HttpContext.Current.CurrentHandler);
		}
		public Shop_BuyMoney(Conn _conn)
		{
			this.conn = _conn;
		}
		public DataTable GetBuyMoneys(int indexpage, int maxperpage, string wherestr, string orderbystr)
		{
			return this.pageHand.GetDataTable("HlShop_BuyMoney", indexpage, maxperpage, "id", wherestr, orderbystr, this.conn, null);
		}
		public DataTable GetBuyMoneys(int indexpage, int maxperpage, string wherestr, string orderbystr, params IDbDataParameter[] param)
		{
			return this.pageHand.GetDataTable("HlShop_BuyMoney", indexpage, maxperpage, "id", wherestr, orderbystr, this.conn, param);
		}
		public string GetPagePanel(string linkHead)
		{
			this.pageHand.P_LinkHead = linkHead;
			return this.pageHand.ShowPagePanel();
		}
		public DataTable GetBuyMoneyByID(int ID)
		{
			return this.conn.GetDataTable("Select * From [HlShop_BuyMoney] Where ID=" + ID);
		}
		public DataTable GetBuyMoneyByOrdernum(string OrderNum)
		{
			IDbDataParameter dbDataParameter = this.conn.CreateParameter("@OrderNum", DbType.String, OrderNum);
			return this.conn.GetDataTable("Select * From [HlShop_BuyMoney] Where ([ordernum] = @OrderNum)", new IDbDataParameter[]
			{
				dbDataParameter
			});
		}
		public bool DeleteBuyMoney(string IDArray)
		{
			return this.conn.Execute("Select * From [HlShop_BuyMoney] Where id in(" + IDArray + ")") >= 0;
		}
		public bool PayBuyMoney(decimal PayMoney, int ID)
		{
			bool result;
			try
			{
				result = false;
			}
			catch
			{
				result = false;
			}
			return result;
		}
		public bool UpdateStatus(int Status, string IDArray)
		{
			return this.conn.Execute(string.Concat(new object[]
			{
				"UpDate [HlShop_BuyMoney] Set Status=",
				Status,
				" Where ID in(",
				IDArray,
				")"
			})) >= 1;
		}
		public bool UpdateBuyMoney(int ID)
		{
			return false;
		}
		public bool AddBuyMoney(string ordernum, int paytype, int userid, decimal money, decimal originalityMoney, string remark)
		{
			return false;
		}
	}
}
